Two structures were previously proposed for magnetic field sensors utilizing magnetic tunnel junctions. One structure measures the external magnetic field in the horizontal direction, and the other measures the external magnetic field in the vertical direction, as shown in FIGS. 1A and 1B respectively. The magnetic field sensors in FIGS. 1A and 1B both include a reference layer (also called pinned layer) 110, a spacer 120, a sensing layer (also called free layer) 130, and the magnetization directions of the reference layer 110 and the sensing layer 130 are mutually perpendicular under zero external magnetic field. M represents the magnetization vector of the sensing layer 130. To measure the external magnetic field Hext in the horizontal direction (the xz-plane), the direction of the magnetization vector Mp of the reference layer 110 of the magnetic field sensor in FIG. 1A is along the horizontal direction (x axis in the figure), and the easy axis 140 of the sensing layer 130 is along the y (vertical coordinate) direction. The external magnetic field Hext pushes M away from the easy axis 140 between the parallel (P) and anti-parallel (AP) configurations, producing an output tunnel magnetoresistance (TMR) signal, which is read out with the aid of Mp. To measure the external magnetic field Hext in the vertical direction, the direction of the magnetization vector Mp of the reference layer 110 of the magnetic field sensor in FIG. 1B is along the y direction, and the easy axis 150 of the sensing layer 130 is along the x direction. Similarly, the external magnetic field Hext in the vertical direction pushes M away from the easy axis 150 between the parallel (P) and anti-parallel (AP) configurations, producing an output TMR signal, which is read out with the aid of Mp. It is very inconvenient practically, because two different structures are needed to measure the horizontal component and the vertical component of the same magnetic field.
In order to overcome the drawbacks in the prior art, a magnetic field sensing device and method is disclosed. The purpose of the present invention is to provide a magnetic field sensing device and method that can detect an external magnetic field in both the horizontal and vertical directions with one structure, which is practically convenient. The particular design in the present invention not only solves the problems described above, but also is easy to implement. Thus, the present invention has utility for the industry.